package com.jinkaimen.kqb.ui.holder;

import android.widget.TextView;

import com.ht.baselibs.ui.base.BaseViewHolder;
import com.jinkaimen.kqb.R;
import com.jinkaimen.kqb.bean.SaleListItemBean;

public class SaleManagerViewHolder extends BaseViewHolder<SaleListItemBean> {

    private TextView mIsLeaderView;
    private TextView mNameView;
    private TextView mShopNameView;

    public SaleManagerViewHolder() {
        super(R.layout.list_sale_manager_item);
    }

    @Override
    protected void initView() {
        mIsLeaderView = (TextView) findViewById(R.id.tv_list_shop_manager_item_shop_is_sale_leader);
        mNameView = (TextView) findViewById(R.id.tv_list_shop_manager_item_sale_name);
        mShopNameView = (TextView) findViewById(R.id.tv_list_shop_manager_item_shop_name);
    }

    @Override
    protected void refreshView(SaleListItemBean saleListItemBean) {
        if (saleListItemBean.role == 2){
            mIsLeaderView.setText("店长");
            mIsLeaderView.setBackgroundResource(R.drawable.shape_red);
        } else if (saleListItemBean.role == 3){
            mIsLeaderView.setText("店员");
            mIsLeaderView.setBackgroundResource(R.drawable.shape_green);
        }

        mNameView.setText(saleListItemBean.realname);
        mShopNameView.setText(saleListItemBean.shopShortName);
    }
}
